package cn.uc.ucgc.community.upgrade;

public final class Constants {
    public static final String UPGRADE_DIR_KEY = "upgrade.dir";
    public static final String DEF_CHARSET = "utf-8";
    public static final String TASK_SPLIT =   "-------------------------------------";
    public static final String TASK_RESULT_BEGIN =   "---start   task---";
    public static final String TASK_RESULT_END =   "---end   task---";
    public static final String TASK_RESULT_PREFIX =   "Do Task: ";
    public static final String TASK_RESULT_NOTASK_SUFFIX =   "Result: No Task";
    public static final String TASK_RESULT_OK_SUFFIX =   " Result: OK";
    public static final String TASK_RESULT_FAILED_SUFFIX =   "Result: Failed";
    public static final String LINE_SEPARATOR = System.getProperty("line.separator", "\r\n");
    public static final char SPLIT_CHAR = '|';
    //任务执行的文件夹
    public static final String PREPARE_FLODER_NAME = "prepare";
    public static final String EXECUTE_FLODER_NAME = "execute";
    public static final String REVISE_FLODER_NAME = "revise";
    //XML配置的标签
    public static final String REPLACE_W_ITEM_PATH = "/replace/wholes/item";
    public static final String REPLACE_PROP_ITEM_PATH = "/replace/properties/item";
    public static final String REPLACE_XML_ITEM_PATH = "/replace/xmls/item";
    public static final String REPLACE_ITEM_SRCPATH = "srcPath";
    public static final String REPLACE_ITEM_DSTPATH = "dstPath";
    public static final String REPLACE_KEY_SRCPATH = "src";
    public static final String REPLACE_KEY_DSTPATH = "dst";
    public static final String REPLACE_KEY_PATH = "key";
    
    public static final String MODIFY_PROP_ITEM_PATH = "/modify/properties/item";
    public static final String MODIFY_XML_ITEM_PATH = "/modify/xmls/item";
    public static final String MODIFY_ITEM_SRCPATH = "path";
    public static final String MODIFY_KEY_PATH = "key";
    public static final String MODIFY_KEY_NAME = "name";
    public static final String MODIFY_KEY_MACRO_VAL = "value";
    public static final String MODIFY_KEY_TIP = "tip";
    public static final String MODIFY_KEY_EXAMPLE = "example";
    
    public static final String ADD_PROP_ITEM_PATH = "/add/properties/item";
    public static final String ADD_ITEM_SRCPATH = "path";
    public static final String ADD_KEY_PATH = "key";
    public static final String ADD_KEY_NAME = "name";
    public static final String ADD_KEY_MACRO_VAL = "value";
    public static final String ADD_KEY_TIP = "tip";
    public static final String ADD_KEY_EXAMPLE = "example";

    public static final String DELETE_PROP_ITEM_PATH = "/delete/properties/item";
    public static final String DELETE_XML_ITEM_PATH = "/delete/xmls/item";
    public static final String DELETE_ITEM_SRCPATH = "path";
    public static final String DELETE_KEY_PATH = "key";
    public static final String DELETE_KEY_NAME = "name";
    
    public static final String SHELL_PREPARE_ITEM_PATH = "/shell/prepare/item";
    public static final String SHELL_EXECUTE_ITEM_PATH = "/shell/execute/item";
    public static final String SHELL_REVISE_ITEM_PATH = "/shell/revise/item";
    public static final String SHELL_ITEM_CMDPATH = "cmdPath";
    public static final String SHELL_ITEM_CMDPARAMS = "params";
    
    public static final String TOOL_HELP_OPTION = "-help";
    public static final String TOOL_APP_OLD_PATH_OPTION = "-o";
    public static final String TOOL_APP_NEW_PATH_OPTION = "-n";
    public static final String TOOL_CONF_PATH_OPTION = "-c";
    public static final String TOOL_MACRO_OPTION = "[operation]";
    public static final String TOOL_MACRO_CMD = "cm";
    
    public static final String TOOL_OPTION_ERROR_TIP = "Some options must be enter." + LINE_SEPARATOR
                                                    + "try '-help' for more information.";
    public static final String TOOL_HELP_TIP = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+LINE_SEPARATOR+
            "Usage: upgrade -o oldVersionPath -n newVersionPath -c confPath "+TOOL_MACRO_OPTION+LINE_SEPARATOR+
            "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+LINE_SEPARATOR+
            "for all commands, if the application is not specified, corresponding task will be ignored!" + LINE_SEPARATOR
                                                    + "core commands:" + LINE_SEPARATOR + "~~~~~~~~~~~~~~" + LINE_SEPARATOR
                                                    + "option \t     not-null \t tip" + LINE_SEPARATOR
                                                    + TOOL_APP_OLD_PATH_OPTION + "\t\tY\t" + "absolute path of old version, like /home/web/msg-1.0.0/"  + LINE_SEPARATOR
                                                    + TOOL_APP_NEW_PATH_OPTION + "\t\tY\t" + "absolute path of new version, like /home/web/msg-1.0.1/" + LINE_SEPARATOR
                                                    + TOOL_CONF_PATH_OPTION + "\t\tN\t" + "absolute path of the conf directory,if not define use default" + LINE_SEPARATOR
                                                    + TOOL_MACRO_OPTION + "\tN\t" + "valid operation is [cm],cm short of 'collect macro'" + LINE_SEPARATOR;
    public static final String TOOL_OPTION_ENTER_ERROR_TIP = "Some illegal input exists" + LINE_SEPARATOR
                                                                + "try '-help' for more information." + LINE_SEPARATOR;
    
}
